package com.boho.system.action;

/**
 * @File name:  LoginAction.java 
 * @Create on:  2010-05-10
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 **/
           
        

            
import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.exception.UserOperationException;
import cn.boho.framework.service.MessageService;

import com.boho.system.service.LoginService;


public class LoginAction extends ActionImp {
	@Override
	protected void doException(ActionContext atx, Exception ex) {
		if (!(ex instanceof UserOperationException)) {
			atx.setErrorContext("BOHO_COMMON_1008", MessageService.getMessage("BOHO_COMMON_1008"),"【用户登录】", ex);
		}
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		String loginName = atx.getStringValue("LOGIN_NAME","").trim();
		String password = atx.getStringValue("PASSWORD");
		LoginService.login(atx,loginName,password);
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		return 1;
	}
}

